What is the `/etc/hostname` used/required for?

Posted by static on Super User See other posts from Super User or by static
Published on 2012-11-22T15:57:24Z Indexed on 2012/11/22 17:02 UTC
Read the original article Hit count: 156

Filed under:
|
|
|
|

I found in the /etc/hostname my IP-address, than I deleted it and each time I use sudo - I get a message and a system email sudo: unable to resolve host (none) or if in the /etc/hostname is saved myhostname than sudo: unable to resolve host (myhostname).

I know it is used to set the system's hostname via /etc/init.d/hostname.sh while booting process, but what is this setting required for (programs, services, daemons ...)?

What if i set to localhost (so it doesn't happen any sudo: unable to resolve host (none) anymore, but is it still ok?)?

UPD1:

I found some information here: http://jblevins.org/log/hostname, but it is all about how to use it and not about - why it is required.

© Super User or respective owner

Related posts about boot

Related posts about configuration